<%--
  Created by IntelliJ IDEA.
  User: 杨威
  Date: 2021/9/15
  Time: 15:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>欢迎您${user.userName}</h1><br/>
<a href="insert.jsp">新增书籍</a>
<table border="1">
    <tr>
        <th>编号</th>
        <th>书名</th>
        <th>作者</th>
        <th>出版日期</th>
        <th>出版社</th>
        <th>图书编码</th>
        <th>图书价格</th>
        <th>操作</th>
    </tr>

    <c:forEach items="${books}" var="book">
        <tr>
            <td>${book.bId}</td>
            <td>${book.bTitle}</td>
            <td>${book.bAuthor}</td>
            <td>${book.bPublicDate}</td>
            <td>${book.bPublisher}</td>
            <td>${book.bIsbn}</td>
            <td>${book.bPrice}</td>
            <td><a href="showBook?bId=${book.bId}">修改</a><a href="delete?bId=${book.bId}">删除</a></td>
        </tr>
    </c:forEach>
    <tr>
        <td colspan="7" align="center">
            <a href="ShowAllBookController?pageIndex=1">首页</a>
            <c:if test="${page.pageIndex>1}">
                <a href="ShowAllBookController?pageIndex=${page.pageIndex-1}">上一页</a>
            </c:if>
            <c:if test="${page.pageIndex<page.totalPage}">
                <a href="ShowAllBookController?pageIndex=${page.pageIndex+1}">下一页</a>
            </c:if>

            <a href="ShowAllBookController?pageIndex=${page.totalPage}">尾页</a>
        </td>
    </tr>
</table>
</body>
</html>
